package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 涛
 * Date: 2023-10-23
 * Time: 9:56
 */
public class Test {
    /**
     * Class对象只有一个
     * @param args
     */
    public static void main(String[] args) {
        Class<?> c1 = null;
        try {
            c1 =  Class.forName("demo1.Student");
        } catch(ClassNotFoundException e) {
            e.printStackTrace();
        }
        
        Class<?> c2 = Student.class;
        
        Student student = new Student();
        Class c3 = student.getClass();

        System.out.println(c1 == c2);
        System.out.println(c1 == c3);
    }
}
